/* 字典类目列显示 */
const columnList = [
	{comment: "id", field: "id", isShow: false},
	{comment: "编码", field: "code", isShow: true},
	{comment: "名称", field: "name", isShow: true},
	{comment: "系统内置", field: "innerText", isShow: true},
	{comment: "创建时间", field: "createTime", isShow: true},
	{comment: "更新时间", field: "updateTime", isShow: true},
	{comment: "备注", field: "remarks", isShow: true},
]
export default {
	namespaced: true,
	state: {
		columns: columnList
	},
	mutations: {
		updateColumns(state, selected) {
			// console.log(selected)
			state.columns.map(value => {
				value.isShow = selected.indexOf(value.field) > -1
			})
		}
	},
	getters: {
		selectedColumns: state => state.columns.filter(value => value.isShow),
		selectedFields:  (state, getters) => getters.selectedColumns.map(value => value.field)
	}
}
